﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.DesignServer.Data
{
    [MessageContract]
    public class GetLatestVersionResponse
    {
        [MessageHeader]
        public bool IsSuccess { get; set; }
        [MessageHeader]
        public int ErrorCode { get; set; }

        [MessageHeader]
        public string Message { get; set; }

        [MessageHeader]
        public Guid ItemId { get; set; }
        
        [MessageHeader]
        public Guid ItemParentId { get; set; }

        [MessageHeader]
        public Guid ItemFolderId { get; set; }

        [MessageHeader]
        public string ItemName { get; set; }

        [MessageHeader]
        public int ItemVersion { get; set; }

        [MessageHeader]
        public int ItemType { get; set; }

        [MessageBodyMember]
        public Stream Content { get; set; }

        [MessageHeader]
        public bool IsEditing { get; set; }
        [MessageHeader]
        public string Editor { get; set; }
        [MessageHeader]
        public string ItemExtension { get; set; }

        public GetLatestVersionResponse()
        {

        }

        public GetLatestVersionResponse(bool isSuccess, int errorCode, string message, Guid itemId, string itemName, int itemVersion, Guid parentId, Guid folderId, int itemType, Stream content, bool isEditing, string editor, string itemExtension)
        {
            this.IsSuccess = isSuccess;
            this.ErrorCode = errorCode;
            this.Message = message;
            this.ItemId = itemId;
            this.ItemName = itemName;
            this.ItemVersion = itemVersion;
            this.ItemParentId = parentId;
            this.ItemFolderId = folderId;
            this.ItemType = itemType;
            this.Content = content;
            this.IsEditing = isEditing;
            this.Editor = editor;
            this.ItemExtension = itemExtension;
        }
    }
}
